package models

import (
	"gorm.io/gorm"
)

type UserBasic struct {
	gorm.Model
	UserId        string  `gorm:"size:64;comment:用户UUID"`
	Name          string  `gorm:"size:20;comment:用户名"`
	Password      string  `gorm:"size:50;comment:密码"`
	PhoneNumber   string  `gorm:"size:11;comment:手机号"`
	Email         *string `gorm:"size:255;comment:邮箱地址"`
	Identity      *string `gorm:"size:255;comment:身份标识"`
	ClientIp      string  `gorm:"size:45;comment:客户端IP地址"`
	ClientPort    string  `gorm:"size:10;comment:客户端端口号"`
	LoginTime     uint64  `gorm:"default:0;comment:登录时间戳"`
	HeartbeatTime uint64  `gorm:"default:0;comment:心跳时间戳"`
	LogOutTime    uint64  `gorm:"default:0;comment:注销时间戳"`
	IsLogOut      bool    `gorm:"default:false;comment:是否已注销"`
	DeviceInfo    *string `gorm:"type:json;comment:设备信息"`
}

func (table *UserBasic) TableName() string {
	return "user_basic"
}
